//$(function(){
//	var checkBox=$("input[type='checkbox']");
//	checkBox.bind("click",function(){
//		getlanguage(checkBox.val())
//		})
//	
//})
function shenqing() {
	var gui_tel = document.getElementById("gui_tel")
	var gui_email = document.getElementById("gui_email")
	var gui_qq = document.getElementById("gui_qq")
	var oError = document.getElementById("error_box")
	var isError = true

	//手机号验证
	var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
	if(!myreg.test(gui_tel.value)) {
		oError.innerHTML = "请输入有效的手机号码！";
		return false;
	}

	//邮箱验证
	var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
	if(!reg.test(gui_email.value)) {
		alert("邮箱格式不正确！");
	}

	//QQ号验证
	if(gui_qq.value.length > 11 || gui_qq.value.length < 6) {
		oError.innerHTML = "请输入正确的QQ号！"
		isError = false;
		return;
	}

//	//身份证验证
//	var reg = /(\d{15}$)|(^\d{18}$)|(\d{17}(\d|X|x)$)/; //验证号码
//	if(reg.test(gui_idcard.value) === false) {
//		alert("身份证输入不合法！")
//		return false;
//	}
	var langNames =[]
		$("input[type='checkbox'][name='lang_name']").each(function() {
			if ($(this).is(":checked")) {
				langNames[langNames.length]=$(this).val()
			}
		});
	var s=langNames.join(",").substring(0)
	alert(s)
	
	var ServiceNames =[]
		$("input[type='checkbox'][name='service_name']").each(function() {
			if ($(this).is(":checked")) {
				ServiceNames[ServiceNames.length]=$(this).val()
			}
		});
	var s1=ServiceNames.join(",").substring(0)
	alert(s1)
	
	var data = $.param({"gui_uid":$("#gui_uid").html()}) +"&"+"langNames="+s+"&"+"ServiceNames="+s1+ "&" + $("form").serialize() + "";

	//提交到数据库
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/GuideServlet/addGuide",
		data: data,
		success: function(data) {
			if(data.status){
				location.href = "member_avatar.html"
				alert("申请成功")
			}
			else
				alert(data.msg)
		},
		dataType: "json"
	})
}


//
//function getlanguage(value){
//	$("#lang").append("<button type='button'>"+value+"</button>")
//}
